package com.ayuan.blog.common.wechat.common;

public enum WechatReturnCode {

	// common
	SUCCESS								(0, "success"),
	FAIL								(7999999, "fail"),
	SUBMIT_SUCCESS						(1,"操作成功"),
	SUBMIT_FAIL							(7999998,"操作失败"),
	ARGS_EMPTY							(7999997,"参数为空"),
	VERSION_NOT_MATCH					(7999997,"数据版本不匹配"),
	DATA_UNIQUE							(7999996,"数据不唯一"),
	UNSUPPORTED_DATATYPEVALUE			(7999996,"不支持的数据类型值"),
	
	OBJECT_DELETED						(7999995,"对象不存在"),
	ARGS_ERROR							(7999994,"参数错误"),

	CODE_7999999  (7999999, "fail"),
	CODE_1        (1,       "操作成功"),
	CODE_7999998  (7999998, "操作失败"),
	CODE_7999997  (7999997, "参数为空"),
//	CODE_7999997  (7999997, "数据版本不匹配"),
	CODE_7999996  (7999996, "数据不唯一"),
//	CODE_7999996  (7999996, "不支持的数据类型值"),
	CODE_7999995  (7999995, "对象不存在"),
	CODE_7999994  (7999994, "参数错误"),

	CODE_S1      (-1,      "系统繁忙，此时请开发者稍候再试"),
	CODE_0       (0,       "请求成功"),
	CODE_40001   (40001,   "获取access_token时AppSecret错误，或者access_token无效。请开发者认真比对AppSecret的正确性，或查看是否正在为恰当的公众号调用接口"),
	CODE_40002   (40002,   "不合法的凭证类型"),
	CODE_40003   (40003,   "不合法的OpenID，请开发者确认OpenID（该用户）是否已关注公众号，或是否是其他公众号的OpenID"),
	CODE_40004   (40004,   "不合法的媒体文件类型"),
	CODE_40005   (40005,   "不合法的文件类型"),
	CODE_40006   (40006,   "不合法的文件大小"),
	CODE_40007   (40007,   "不合法的媒体文件id"),
	CODE_40008   (40008,   "不合法的消息类型"),
	CODE_40009   (40009,   "不合法的图片文件大小"),
	CODE_40010   (40010,   "不合法的语音文件大小"),
	CODE_40011   (40011,   "不合法的视频文件大小"),
	CODE_40012   (40012,   "不合法的缩略图文件大小"),
	CODE_40013   (40013,   "不合法的AppID，请开发者检查AppID的正确性，避免异常字符，注意大小写"),
	CODE_40014   (40014,   "不合法的access_token，请开发者认真比对access_token的有效性（如是否过期），或查看是否正在为恰当的公众号调用接口"),
	CODE_40015   (40015,   "不合法的菜单类型"),
	CODE_40016   (40016,   "不合法的按钮个数"),
	CODE_40017   (40017,   "不合法的按钮个数"),
	CODE_40018   (40018,   "不合法的按钮名字长度"),
	CODE_40019   (40019,   "不合法的按钮KEY长度"),
	CODE_40020   (40020,   "不合法的按钮URL长度"),
	CODE_40021   (40021,   "不合法的菜单版本号"),
	CODE_40022   (40022,   "不合法的子菜单级数"),
	CODE_40023   (40023,   "不合法的子菜单按钮个数"),
	CODE_40024   (40024,   "不合法的子菜单按钮类型"),
	CODE_40025   (40025,   "不合法的子菜单按钮名字长度"),
	CODE_40026   (40026,   "不合法的子菜单按钮KEY长度"),
	CODE_40027   (40027,   "不合法的子菜单按钮URL长度"),
	CODE_40028   (40028,   "不合法的自定义菜单使用用户"),
	CODE_40029   (40029,   "不合法的oauth_code"),
	CODE_40030   (40030,   "不合法的refresh_token"),
	CODE_40031   (40031,   "不合法的openid列表"),
	CODE_40032   (40032,   "不合法的openid列表长度"),
	CODE_40033   (40033,   "不合法的请求字符，不能包含\\uxxxx格式的字符"),
	CODE_40035   (40035,   "不合法的参数"),
	CODE_40036   (40036,   "缺少模板消息id字段"),
	CODE_40037	 (40037,   "模板消息id错误"),
	CODE_40038   (40038,   "不合法的请求格式"),
	CODE_40039   (40039,   "不合法的URL长度"),
	CODE_40050   (40050,   "不合法的分组id"),
	CODE_40051   (40051,   "分组名字不合法"),
	CODE_40117   (40117,   "分组名字不合法"),
	CODE_40118   (40118,   "media_id大小不合法"),
	CODE_40119   (40119,   "button类型错误"),
	CODE_40120   (40120,   "button类型错误"),
	CODE_40121   (40121,   "不合法的media_id类型"),
	CODE_40130   (40130,   "不合法的openID集合大小,需要至少包含两个openID"),
	CODE_40132   (40132,   "微信号不合法"),
	CODE_40137   (40137,   "不支持的图片格式"),
	CODE_41001   (41001,   "缺少access_token参数"),
	CODE_41002   (41002,   "缺少appid参数"),
	CODE_41003   (41003,   "缺少refresh_token参数"),
	CODE_41004   (41004,   "缺少secret参数"),
	CODE_41005   (41005,   "缺少多媒体文件数据"),
	CODE_41006   (41006,   "缺少media_id参数"),
	CODE_41007   (41007,   "缺少子菜单数据"),
	CODE_41008   (41008,   "缺少oauth code"),
	CODE_41009   (41009,   "缺少openid"),
	CODE_42001   (42001,   "access_token超时，请检查access_token的有效期，请参考基础支持-获取access_token中，对access_token的详细机制说明"),
	CODE_42002   (42002,   "refresh_token超时"),
	CODE_42003   (42003,   "oauth_code超时"),
	CODE_43001   (43001,   "需要GET请求"),
	CODE_43002   (43002,   "需要POST请求"),
	CODE_43003   (43003,   "需要HTTPS请求"),
	CODE_43004   (43004,   "需要接收者关注"),
	CODE_43005   (43005,   "需要好友关系"),
	CODE_43100   (43100,   "行业id调用次数超过限制，一个月仅限一次"),
	CODE_44001   (44001,   "多媒体文件为空"),
	CODE_44002   (44002,   "POST的数据包为空"),
	CODE_44003   (44003,   "图文消息内容为空"),
	CODE_44004   (44004,   "文本消息内容为空"),
	CODE_45001   (45001,   "多媒体文件大小超过限制"),
	CODE_45002   (45002,   "消息内容超过限制"),
	CODE_45003   (45003,   "标题字段超过限制"),
	CODE_45004   (45004,   "描述字段超过限制"),
	CODE_45005   (45005,   "链接字段超过限制"),
	CODE_45006   (45006,   "图片链接字段超过限制"),
	CODE_45007   (45007,   "语音播放时间超过限制"),
	CODE_45008   (45008,   "图文消息超过限制"),
	CODE_45009   (45009,   "接口调用超过限制"),
	CODE_45010   (45010,   "创建菜单个数超过限制"),
	CODE_45015   (45015,   "回复时间超过限制"),
	CODE_45016   (45016,   "系统分组，不允许修改"),
	CODE_45017   (45017,   "分组名字过长"),
	CODE_45018   (45018,   "分组数量超过上限"),
	CODE_45026   (45026,   "微信后台模板消息ID数量已达上限"),
	CODE_45028   (45028,   "没有群发权限/群发额度已用完"),
	CODE_46001   (46001,   "不存在媒体数据"),
	CODE_46002   (46002,   "不存在的菜单版本"),
	CODE_46003   (46003,   "不存在的菜单数据"),
	CODE_46004   (46004,   "不存在的用户"),
	CODE_47001   (47001,   "解析JSON/XML内容错误"),
	CODE_48001   (48001,   "api功能未授权，请确认公众号已获得该接口，可以在公众平台官网-开发者中心页中查看接口权限"),
	CODE_50001   (50001,   "用户未授权该api"),
	CODE_50002   (50002,   "用户受限，可能是违规后接口被封禁"),
	CODE_61451   (61451,   "参数错误(invalid parameter)"),
	CODE_61452   (61452,   "无效客服账号(invalid kf_account)"),
	CODE_61453   (61453,   "客服帐号已存在(kf_account exsited)"),
	CODE_61454   (61454,   "客服帐号名长度超过限制(仅允许10个英文字符，不包括@及@后的公众号的微信号)(invalid kf_acount length)"),
	CODE_61455   (61455,   "客服帐号名包含非法字符(仅允许英文+数字)(illegal character in kf_account)"),
	CODE_61456   (61456,   "客服帐号个数超过限制(10个客服账号)(kf_account count exceeded)"),
	CODE_61457   (61457,   "无效头像文件类型(invalid file type)"),
	CODE_61450   (61450,   "系统错误(system error)"),
	CODE_61500   (61500,   "日期格式错误"),
	CODE_61501   (61501,   "日期范围错误"),
	CODE_9001001 (9001001, "POST数据参数不合法"),
	CODE_9001002 (9001002, "远端服务不可用"),
	CODE_9001003 (9001003, "Ticket不合法"),
	CODE_9001004 (9001004, "获取摇周边用户信息失败"),
	CODE_9001005 (9001005, "获取商户信息失败"),
	CODE_9001006 (9001006, "获取OpenID失败"),
	CODE_9001007 (9001007, "上传文件缺失"),
	CODE_9001008 (9001008, "上传素材的文件类型不合法"),
	CODE_9001009 (9001009, "上传素材的文件尺寸不合法"),
	CODE_9001010 (9001010, "上传失败"),
	CODE_9001020 (9001020, "帐号不合法"),
	CODE_9001021 (9001021, "已有设备激活率低于50%，不能新增设备"),
	CODE_9001022 (9001022, "设备申请数不合法，必须为大于0的数字"),
	CODE_9001023 (9001023, "已存在审核中的设备ID申请"),
	CODE_9001024 (9001024, "一次查询设备ID数量不能超过50"),
	CODE_9001025 (9001025, "设备ID不合法"),
	CODE_9001026 (9001026, "页面ID不合法"),
	CODE_9001027 (9001027, "页面参数不合法"),
	CODE_9001028 (9001028, "一次删除页面ID数量不能超过10"),
	CODE_9001029 (9001029, "页面已应用在设备中，请先解除应用关系再删除"),
	CODE_9001030 (9001030, "一次查询页面ID数量不能超过50"),
	CODE_9001031 (9001031, "时间区间不合法"),
	CODE_9001032 (9001032, "保存设备与页面的绑定关系参数错误"),
	CODE_9001033 (9001033, "门店ID不合法"),
	CODE_9001034 (9001034, "设备备注信息过长"),
	CODE_9001035 (9001035, "设备申请参数不合法"),
	CODE_9001036 (9001036, "查询起始值begin不合法"),

	CODE_9002006 (9002006, "未开通微信连Wi-Fi连插件"),

	LOCAL_ERROR_001 (99000001, "本地处理错误");

	class ErrorEntity {
		public int errcode;
		public String errmsg;
	}

	public ErrorEntity entity = new ErrorEntity();
	
	private WechatReturnCode(int errcode, String errmsg) {
		this.entity.errcode = errcode;
		this.entity.errmsg = errmsg;
	}
	
	public int getCode() {
		return this.entity.errcode;
	}
	
	public String getMsg() {
		return this.entity.errmsg;
	}
}
